// pages/my/index.js
const App = getApp()

Page({

  /**
   * 页面的初始数据
   */
  data: {
    cardData: null,
    advantageList: [
      {icon: "../../images/icon_03.png", name: "实体会员卡"},
      {icon: "../../images/icon_04.png", name: "月度优惠券"},
      {icon: "../../images/icon_05.png", name: "积分兑好礼"},
      {icon: "../../images/icon_06.png", name: "月首单双倍积分"},
      {icon: "../../images/icon_07.png", name: "生日专属券"},
      {icon: "../../images/icon_08.png", name: "等级倍数积分"},
      {icon: "../../images/icon_09.png", name: "新品免费试"},
      {icon: "../../images/icon_10.png", name: "敬请期待"}
    ],
  },


  onShow () {
    this.setData({
      isLogin: App.checkIsLogin()
    });
    if (this.data.isLogin) {
      this.setData({cardData:null})
      this.getUserDetail();
    }
  },
  getUserDetail(){
    let userInfo=wx.getStorageSync('userInfo')
    this.setData({
      cardData:userInfo,
      userInfo,
    })
  },
  LogoutHandle(){
    wx.clearStorageSync()
    wx.switchTab({
      url:'/pages/index/index'
    })
  }
})